import { hx2292, hx2293, hx2294 } from './lv6/exam_answer.js'
import work63775 from './lv7/work11_63775.js'
import work63776 from './lv7/work12_63776.js'
import work63777 from './lv7/work13_63777.js'
import work83486 from './lv7/work21_83486.js'
import work83487 from './lv7/work22_83487.js'
import work83488 from './lv7/work23_83488.js'
import work195986 from './lv7/work31_195986.js'
import work195987 from './lv7/work32_195987.js'
import work195988 from './lv7/work33_195988.js'
import work149475 from './lv8/work11_149475.js'
import work149476 from './lv8/work12_149476.js'
import work149477 from './lv8/work13_149477.js'
import work149500 from './lv8/work21_149500.js'
import work149501 from './lv8/work22_149501.js'
import work149502 from './lv8/work23_149502.js'
import work58577 from './lv8/work31_58577.js'
import work58578 from './lv8/work32_58578.js'
import work58579 from './lv8/work33_58579.js'

const answerData = {
  // lv6 exam
  work2292: hx2292,
  work2293: hx2293,
  work2294: hx2294,
  // lv7 work1
  work63775,
  work63776,
  work63777,
  // lv7 work2
  work83486,
  work83487,
  work83488,
  // lv7 work3
  work195986,
  work195987,
  work195988,
  // lv8 work1
  work149475,
  work149476,
  work149477,
  // lv8 work2
  work149500,
  work149501,
  work149502,
  // lv8 work3
  work58577,
  work58578,
  work58579,
  // lv8 exam
}

export default query => {
  return new Promise((resolve, reject) => {
    const tk = query.token
    const id = query.id
    if (!id || !tk) {
      reject(new Error('参数不完整'))
    }
    const answer = answerData[`work${id}`] || {}
    if (answer?.title) {
      resolve(answer)
    } else {
      reject(new Error('无该课程数据'))
    }
  })
}
